IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings_DeleteMailing]') AND type in (N'P', N'PC'))
DROP PROCEDURE [xz_Mailings_DeleteMailing]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings_GetMailingByID]') AND type in (N'P', N'PC'))
DROP PROCEDURE [xz_Mailings_GetMailingByID]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings_GetMailings]') AND type in (N'P', N'PC'))
DROP PROCEDURE [xz_Mailings_GetMailings]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings_InsertMailing]') AND type in (N'P', N'PC'))
DROP PROCEDURE [xz_Mailings_InsertMailing]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings_UpdateMailing]') AND type in (N'P', N'PC'))
DROP PROCEDURE [xz_Mailings_UpdateMailing]
GO

IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[FK_xz_Mailings_aspnet_Applications]') AND parent_object_id = OBJECT_ID(N'[xz_Mailings]'))
ALTER TABLE [dbo].[xz_Mailings] DROP CONSTRAINT [FK_xz_Mailings_aspnet_Applications]
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[xz_Mailings]') AND type in (N'U'))
DROP TABLE [xz_Mailings]